<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('user/index')}">{:L('ADMIN_USER_INDEX')}</a></li>
			<li><a href="{:U('user/add')}">{:L('ADMIN_USER_ADD')}</a></li>
		</ul>
        <form class="well form-search form-inline" method="post" action="{:U('User/index')}">

            <div class="form-group">
                <label >账号</label>
                <input type="text" name="user_login" class="form-control"  value="{:I('request.user_login/s','')}" placeholder="请输入账号">
                <label>姓名</label>
                <input type="text" name="real_name" class="form-control"  value="{:I('request.real_name/s','')}" placeholder="请输入用户名">
            </div>
            <button class="btn btn-primary" type="submit">搜索</button>
            <a class="btn btn-danger" href="{:U('User/index')}">清空</a>
        </form>
		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="200">登录名称</th>
					<th>真实姓名</th>
					<th>所属单位</th>
					<th>用户权限</th>
					<th>创建人</th>
					<th width="200">最后修改时间</th>
					<th>最后登录IP</th>
					<th width="120">{:L('ACTIONS')}</th>
				</tr>
			</thead>
			<tbody>
				<php>$user_statuses=array("0"=>L('USER_STATUS_BLOCKED'),"1"=>L('USER_STATUS_ACTIVATED'),"2"=>L('USER_STATUS_UNVERIFIED'));</php>
				<foreach name="users" item="vo">
				<tr>
					<td><if condition="$vo['user_url']"><a href="{$vo.user_url}" target="_blank" title="{$vo.signature}">{$vo.user_login}</a><else />{$vo.user_login}</if></td>
					<td>{$vo.real_name}</td>
					<td>{$vo.department_name}</td>
					<td>
                    	<if condition="$vo['role_id'] eq 1">
                        	查看权
                        <elseif condition="$vo['role_id'] eq 2"/>
                        	编辑权
                        <elseif condition="$vo['role_id'] eq 3"/>
                        	审核权	
                        <elseif condition="$vo['role_id'] eq 4"/>
                        	分配权	
                        <else />
							所有权限
						</if>
                    </td>
					<td>{$vo.add_user}</td>
					<td>{$vo.last_time}</td>
					<td>{$vo.last_login_ip}</td>
					<td>
						<if condition="$vo['id'] eq 1 || $vo['id'] eq sp_get_current_admin_id()">
						<font color="#cccccc">{:L('EDIT')}</font> | <font color="#cccccc">{:L('DELETE')}</font> 
						<else />
							<a href='{:U("user/edit",array("id"=>$vo["id"]))}'>{:L('EDIT')}</a> |
							<a class="js-ajax-delete" href="{:U('user/delete',array('id'=>$vo['id']))}">{:L('DELETE')}</a> 
						</if>
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
</body>
</html>